from django.conf.urls import url

from apps.users import views

urlpatterns = [
    url(r'^register/$', views.RegisterView.as_view(), name='register'),
    url(r'^usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/$', views.UsernameCountView.as_view(), name='usernamae'),
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$', views.MobileCountView.as_view(), name='mobile'),
    url(r'^login/$', views.LoginView.as_view(), name='login'),
    url(r'^logout/$', views.LogoutView.as_view(), name='logout'),
    url(r'^user_center/$', views.CenterView.as_view(), name='center'),
    url(r'^emails/$', views.EmailView.as_view(), name='email'),
    url(r'^email_active/$', views.EmailActiveView.as_view(), name='email_active'),
    url(r'^addresses/$', views.UserCenterSiteView.as_view(), name='addresses'),
    url(r'^add_addresses/$', views.AddAddressesView.as_view(), name='add_addresses'),
    url(r'^addresses/(?P<address_id>\d+)/$', views.AddressesUpdateView.as_view(), name='addressupdate'),
    url(r'^addresses/(?P<address_id>\d+)/default/$', views.AddressDefaultView.as_view(), name='defaultaddress'),
    url(r'^addresses/(?P<address_id>\d+)/title/$', views.TitleUpdateView.as_view(), name='titleupdate'),
    url(r'^browse_histories/$', views.HistoryView.as_view(), name='history'),
    url(r'^change_pwd/$', views.ChangePasswordView.as_view(), name='change_pwd'),
    url(r'^find_pwd/$', views.FindPwdView.as_view(), name='find_pwd'),
    url(r'^accounts/(?P<username>.*)/sms/token/$', views.FindPwdFirstView.as_view(), name='find_pwd_first'),
    url(r'^sms_codes/$', views.SendSmsCodeView.as_view(), name='find_pwd_sendsms'),
    url(r'^accounts/(?P<username>.*)/password/token/$', views.FindPwdSeconedView.as_view(), name='find_pwd_scend'),
    url(r'^users/(?P<user_id>\d+)/password/$', views.FindPwdThirdView.as_view(), name='find_pwd_third'),
    url(r'^orders/info/(?P<page_num>\d+)/$', views.OrderListView.as_view(), name='order_list'),

]
